package ptaHhl;
import java.util.Scanner;
public class Fivetwo {
	public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int num=0;
        while (in.hasNext()) {
            String A = in.next();
            String B=A; 
             int S = Integer.parseInt(A);
              if(S>=10000&&S<=20000){
                System.out.print(Integer.toBinaryString(S)+",");
                System.out.print(Integer.toOctalString(S)+",");
                System.out.println(Integer.toHexString(S));
            }
              else{
                  char[] arry; 
                  arry =B.toCharArray();  
                  if(arry[0]=='-'){
                       num=0;
                    for(int i=1;i<A.length();i++){
                       System.out.print(arry[i]+" "); 
                       num=num+arry[i]-48;
                    }
                  }
                  else{
                      num=0;
                    for(int i=0;i<A.length();i++){
                       System.out.print(arry[i]+" "); 
                       num=num+arry[i]-48;
                    } 
                  }
                   System.out.print(num); 
                   System.out.printf("%n");
              }
            
        }
    }
}
